<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_transfer`.
 */
class m171228_055532_create_project_transfer_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('project_transfer', [
            'id' => $this->bigPrimaryKey(),
            'project_id' => $this->bigInteger()->notNull()->comment('项目ID'),
            'transfer' => $this->smallInteger()->notNull()->comment('资产包提供方名称'),//1持有人、2居间人
            // 'transfer_title'=>$this->string()->notNull()->comment('资产包提供方名称'),
            'contact' => $this->string()->notNull()->comment('联系人'),
            'phone' => $this->string()->notNull()->comment('电话'),
            'email' => $this->string()->notNull()->comment('邮箱'),
            'address' => $this->string()->notNull()->comment('地址'),
            'position' => $this->string()->comment('职位'),
            'method' => $this->smallInteger()->notNull()->comment('转让方式'),//1整包、2单户、3只参拍
            'wish' =>$this->text()->notNull()->comment('转让意愿'),
            'detail' => $this->text()->notNull()->comment('转让价格'),
            'updated_at'=>$this->timestamp(),
            'lock_user' => $this->integer()->comment('上锁用户'),
            'lock_timestamp' => $this->string()->comment('上锁时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('package_transfer');
    }
}
